package com.neuedu.web;

import com.neuedu.pojo.Category;
import com.neuedu.service.CategoryService;
import com.neuedu.service.CategoryServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "GoAddServlet",urlPatterns = "/go/add")
public class GoAddServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //查询分类
        CategoryService categoryService = new CategoryServiceImpl();
        List<Category> list = categoryService.serchArtCategory();
        request.setAttribute("categoryList",list);
        //转发发帖页
        request.getRequestDispatcher("/WEB-INF/jsp/jie/add.jsp").forward(request,response);
    }
}
